/**
 * Created by HaoYafei on 15/9/25.
 *
 */

function $$ajax(obj){
    if(obj.success){
        var oldSuccess=obj.success;
        obj.success=function(response){
            if(response.httpCode==401){
                top.location.href="/login.html";
            }else{
                oldSuccess(response);
            }
        }
    }
    $.ajax(obj);
}

/**
 * 请求html静态模板
 * @param {Object} url
 */
function $get(url){
	var result;
	$.ajax({
		type:"get",
		url:url,
		async:false,
		success:function(data){
			result = data;
		},
		error:function(err){
			alert("请求失败获取资源不存在!"+err);
		}
	});
	return result;
}
